package org.springboot.szsrcb.controller;




import java.sql.Date;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springboot.szsrcb.entity.Attachment;
import org.springboot.szsrcb.entity.Req_base_info;
import org.springboot.szsrcb.entity.Req_bill;
import org.springboot.szsrcb.entity.Test_base_info;
import org.springboot.szsrcb.entity.Test_bill;
import org.springboot.szsrcb.entity.Test_testing_info;
import org.springboot.szsrcb.entity.User;
import org.springboot.szsrcb.srvice.Att_Service;
import org.springboot.szsrcb.srvice.Req_bill_Service;
import org.springboot.szsrcb.srvice.Test_bill_Service;
import org.springboot.szsrcb.srvice.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/test")
public class TestRestController_modify {

    private static final Logger logger = LoggerFactory.getLogger(TestRestController_modify.class);

	@Autowired
	private Req_bill_Service req_bill_Service;
	
	@Autowired
	private Test_bill_Service test_bill_Service;
	
	@Autowired
	private UserService userService;

	@Autowired
	private Att_Service att_Service;
	
	@RequestMapping(value = "/get_node_value_date")
	public String get_node_value_date(HttpServletRequest request,Model model,Test_base_info test_base_info) {
		String result="";
		
		logger.info("进入 get_node_value_date 处理");
		
		model.addAttribute("Test_base_info", test_base_info);
		String g_test_id=String.valueOf(test_base_info.getTest_id());
		java.util.Date r=test_bill_Service.search_node_value_date_by_test_id_and_value(g_test_id, test_base_info.getNode_value());
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		if (r != null) {
			return sdf.format(r);
		}else{
			return "";
		}
		
	}
	
	@RequestMapping(value = "/test_info_page_relation_funcation")
	public String test_info_page_relation_funcation(HttpServletRequest request) {
		String test_id = request.getParameter("test_id");
		
		Test_testing_info  t=test_bill_Service.search_a_test_testing_info_by_testid(test_id);
		String r="";
		if(t!=null){
			r=t.getRelation_funcation();
		}		 
		 return r;
		}
	
	@RequestMapping(value = "/test_info_page_other_remark")
	public String test_info_page_other_remark(HttpServletRequest request) {
		String test_id = request.getParameter("test_id");
		
		Test_testing_info  t=test_bill_Service.search_a_test_testing_info_by_testid(test_id);
		String r="";
		if(t!=null){
			r=t.getOther_remark();
		}		 
		 return r;
		}
	
	
	@RequestMapping(value = "/test_modify_detail_base_info_save", method = { RequestMethod.POST })
	public boolean test_modify_detail_base_info_save(HttpServletRequest request,Model model,Test_base_info test_base_info) {

		 model.addAttribute("Test_base_info", test_base_info);		
		//logger.info("test_assign_select_req_grid params " + params);
		 Test_base_info  t=test_bill_Service.search_a_test_base_info_by_testid(String.valueOf(test_base_info.getTest_id()));
		boolean r=false;
		if(t==null){
			r=test_bill_Service.save_test_base_info_for_insert(test_base_info);
		}else{
		    r=test_bill_Service.save_test_base_info_in_modify(test_base_info);
		}
		 
		 return r;
	

	}
	
	@RequestMapping(value = "/test_modify_base_info_save_att", method = { RequestMethod.POST })
	public boolean test_modify_base_info_save_att(HttpServletRequest request, Model model,
			Test_base_info test_base_info) {

		model.addAttribute("Test_base_info", test_base_info);
		// logger.info("test_assign_select_req_grid params " + params);
		/*
		 * Test_base_info
		 * t=test_bill_Service.search_a_test_base_info_by_testid(String.valueOf(
		 * test_base_info.getTest_id())); boolean r=false; if(t==null){
		 * test_bill_Service. }else{
		 */
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("relation_test_id", test_base_info.getTest_id());
		map.put("att_ids", test_base_info.getAtt_id());
		boolean r = false;
		if (test_base_info.getAtt_id().equals("")) {
			r = true;
		} else {
			r = att_Service.test_update_att(map);
		}

		return r;

	}
	
	@RequestMapping(value = "/test_modify_detail_base_info_onload", method = { RequestMethod.GET })
	public String test_modify_detail_base_info_onload(HttpServletRequest request,HttpSession httpSession) {
		String login_name=(String) httpSession.getAttribute("login_name");  
		User u =userService.search_a_user(login_name);
		boolean is_leader=userService.is_leader(u.getName());
		String att_button="";
		//if(is_leader){
			att_button="{type : 'button',name : 'att_btn',value : '只保存上传附件信息'}"	;
		//}
		String test_id = request.getParameter("test_id");
		Test_bill test_bill=test_bill_Service.search_a_test_bill_by_id(test_id);
		Req_bill req_bill=req_bill_Service.req_bill_search_by_id(test_bill.getReq_id().toString());
		Test_base_info test_base_info=test_bill_Service.search_a_test_base_info_by_testid(test_id);
		
		String return_s="";
		
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");	
		
		String finish_d=sdf.format(test_bill.getTest_complete_date());
		String plan_date="";
		String actual_date="";
		float actual_workload=0;
		float test_workload=0;
		String test_introduction="";
		String test_remark="";
		String test_difficult="";
		String g_act_workload="";
		String g_node_value="";
		if(test_base_info!=null){
			if(test_base_info.getTest_plan_date()!=null){
			 plan_date=sdf.format(test_base_info.getTest_plan_date());
			}
			if(test_base_info.getActual_finish_date()!=null){
				actual_date=sdf.format(test_base_info.getActual_finish_date());
			} 
			
			
			//actual_workload=test_base_info.getTest_actual_workload();			
			double get_workload=test_bill_Service.search_a_test_act_workload(test_id);
			if( get_workload >0){
				g_act_workload=String.valueOf(get_workload);
			}
			
			//test_introduction=test_base_info.getTest_introduction();
			//test_remark=test_base_info.getTest_remark();
			test_difficult=test_base_info.getTest_difficult();
			test_workload=test_base_info.getTest_workload();
			
			g_node_value=test_base_info.getNode_value();
		}else{
			//test_introduction=test_bill.getTest_guide();
			//test_remark=test_bill.getReq_remark();
		}
		
		String old_att="";
		List<Attachment> att_list=att_Service.search_old_atts_by_test_id(test_id);
		if (att_list != null) {
			for (int i = 0; i < att_list.size(); i++) {
				Attachment att_tmp = att_list.get(i);
				String att_status=att_tmp.getAtt_status();
				String check_status="接收测试";
				if (i==att_list.size()) {
					if (att_status.equals(check_status)) {
						old_att=old_att+"{type:'block',list:["
								+"{type : 'label', name:'"+att_tmp.getAtt_file_name()+"',labelWidth:'200', label:'"+att_tmp.getAtt_file_name()+"'},"
								+"{type : 'newcolumn'},"
								+"{type : 'button',name : 'download_"+att_tmp.getId()+"',value : '下载'}"
						+"]}";	
					} else {
						old_att=old_att+"{type:'block',list:["
								+"{type : 'label', name:'"+att_tmp.getAtt_file_name()+"',labelWidth:'200', label:'"+att_tmp.getAtt_file_name()+"'},"
								+"{type : 'newcolumn'},"
								+"{type : 'button',name : 'download_"+att_tmp.getId()+"',value : '下载'},"
								+"{type : 'newcolumn'},"
								+"{type : 'button',name : 'del_"+att_tmp.getId()+"',value : '删除'}"
						+"]}";	
					}
					
				} else {
					if (att_status.equals(check_status)) {
						old_att=old_att+"{type:'block',list:["
												+"{type : 'label', name:'"+att_tmp.getAtt_file_name()+"',labelWidth:'200', label:'"+att_tmp.getAtt_file_name()+"'},"
												+"{type : 'newcolumn'},"
												+"{type : 'button',name : 'download_"+att_tmp.getId()+"',value : '下载'}"
										+"]},";	
					} else {
						old_att=old_att+"{type:'block',list:["
								+"{type : 'label', name:'"+att_tmp.getAtt_file_name()+"',labelWidth:'200', label:'"+att_tmp.getAtt_file_name()+"'},"
								+"{type : 'newcolumn'},"
								+"{type : 'button',name : 'download_"+att_tmp.getId()+"',value : '下载'},"
								+"{type : 'newcolumn'},"
								+"{type : 'button',name : 'del_"+att_tmp.getId()+"',value : '删除'}"
						+"]},";	
					}

				}
				
			}
		}
		String g_node_value_date="";
		if(g_node_value!=null){
			if(!g_node_value.equals("")){
				java.util.Date get_node_value_date=test_bill_Service.search_node_value_date_by_test_id_and_value(test_id,g_node_value);
				if(get_node_value_date!=null){
					g_node_value_date=sdf.format(get_node_value_date);
				}
				
			}
		}
		return_s="["
				+ "{type: 'block', label: '分配需求',  list:["
								+"{type:'block',list:["						
									+"{type : 'hidden',name : 'test_id',label : 'test ID',labelWidth:'70',position:'label-left', value:'"+test_id+"'}"
								+"]},"
								+"{type:'block',list:["
									+"{type : 'input',name : 'att_group_id',label : 'att_group_id',inputWidth:'150',position:'label-left', hidden:'true',offsetLeft:'25'},"
									+"{type : 'input',name : 'att_id',label : 'att_id',inputWidth:'150',position:'label-left', hidden:'true', offsetLeft:'25'}"										
								+"]},"
								+"{type:'block',list:["
										+"{type : 'select',name : 'test_difficult',label : '测试难度',inputWidth:'150',labelWidth:'100', required:'true',value:'"+test_difficult+"', options:["
												+"{text: '', value: ''},"
												+"{text: '难', value: '难'},"
												+"{text: '中', value: '中'},"
												+"{text: '易', value: '易'}"
										+ "]},"										
										+"{type : 'newcolumn'},"
										+"{type : 'select',name : 'test_status',label : '测试状态',inputWidth:'150', labelWidth:'100',required:'true',offsetLeft:'25',value:'"+test_bill.getTest_status()+"',options:["
												+"{text: '已接收', value: '已接收'},"
												+"{text: '已分配', value: '已分配'},"
												+"{text: '已退回', value: '已退回'},"
												+"{text: '已完成', value: '已完成'}"
										+ "]},"
										+"{type : 'newcolumn'}"
																				
								+"]},"
								+"{type:'block',list:["
										+"{type : 'select',name : 'node_value',label : '项目节点',inputWidth:'150',labelWidth:'100',position:'label-left', required:'true',value:'"+g_node_value+"',options:["
													+"{text: '', value: ''},"
												/*	+"{text: '1领取需求', value: '1领取需求'},"
													+"{text: '2提交需求', value: '2提交需求'},"
													+"{text: '3开始开发', value: '3开始开发'},"
													+"{text: '4系统测试', value: '4系统测试'},"*/
													+"{text: '5应用测试', value: '5应用测试'},"
													+"{text: '6完成测试', value: '6完成测试'},"
													+"{text: '7完成上线', value: '7完成上线'},"
													+"{text: '8结束跟踪', value: '8结束跟踪'}"											
											+ "]},"
										+"{type : 'newcolumn'},"			
										+"{type : 'calendar',name : 'node_value_date',label : '节点对应时间',position:'label-left',offsetLeft:'25', inputWidth:'130',labelWidth:'100', value:'"+g_node_value_date+"', required:'true'},"
								+"]},"
								
								+"{type:'block',list:["
										+"{type : 'calendar',name : 'test_plan_date',label : '计划完成日',position:'label-left', inputWidth:'150', labelWidth:'100',value:'"+plan_date+"', required:'true'},"
										+"{type : 'newcolumn'},"
										+"{type : 'input',name : 'test_workload',label : '计划工作量',inputWidth:'100',labelWidth:'100',position:'label-left', required:'true',value:'"+test_workload+"',offsetLeft:'25'},"
										+"{type : 'newcolumn'},"
										+"{type : 'input',name : 'test_workload_unit',label : '人天',inputWidth:'0',position:'label-left',value:'',disabled:'true'}"
									+"]},"
								+"{type:'block',list:["
									+"{type : 'calendar',name : 'actual_finish_date',label : '实际完成日',position:'label-left', inputWidth:'150',labelWidth:'100', value:'"+actual_date+"'},"
									+"{type : 'newcolumn'},"
									+"{type : 'input',name : 'test_actual_workload',label : '实际工作量',inputWidth:'100',labelWidth:'100',position:'label-left', disabled:'true',value:'"+g_act_workload+"',offsetLeft:'25'},"
									+"{type : 'newcolumn'},"
									+"{type : 'input',name : 'actual_workload_unit',label : '人天',inputWidth:'0',position:'label-left',disabled:'true',value:''}"
								+"]},"									
								+"{type:'block',list:["
									+"{type : 'editor',name : 'test_introduction',label : '测试指引',position:'label-top', inputWidth:'800', inputHeight:'200',value:'"+test_introduction+"'},"
									+"{type : 'editor',name : 'test_remark',label : '其它说明',position:'label-top', inputWidth:'800', inputHeight:'200',value:'"+test_remark+"'}"										
								+"]},"
								+ "{type: 'fieldset', label: '已上传附件',  list:["
									+old_att												
								+"]},"	
								+"{type:'fieldset',label:'附件',list:["
									+"{type : 'label', name:'att_label', label:'上传文件最大值: 100 Mb'},"
									+"{type:'upload', name:'myFiles', inputWidth:'400', titleText:'拖拽文件到此区域或点击选择文件上传', url:'/attachment/upload_test_modify', _swfLogs:'enabled',  autoStart:'true', swfPath:'/common/uploader.swf',  swfUrl:'attachment/upload_test_modify'}"
								+"]},"					
								
								+"{type:'block',list:["
									+"{type : 'button',name : 'base_info_save_btn',value : '保存修改信息'},"
									+"{type : 'newcolumn'},"
									+att_button
									//+"{type : 'button',name : 'assign_btn2',value : '退回'}"										
								+"]}"											
								//+"{type:'block',list:["
								//	+"{type : 'input',name : 'req_title',label : '需求主题',labelWidth:'70', inputWidth='700',position:'label-left', disabled:'true',value:'"+obj.getReq_title()+"'}"
								//+"]}"
							+"]"
					+ "}"
				+"]";
		
		logger.info("retrun info :" + return_s);
		return return_s;
		
	}
	
	@RequestMapping(value = "/test_modify_detail_onload", method = { RequestMethod.GET })
	public String test_modify_detail_onload(HttpServletRequest request) {
		String test_id = request.getParameter("test_id");
		Test_bill test_bill=test_bill_Service.search_a_test_bill_by_id(test_id);
		Req_bill req_bill=req_bill_Service.req_bill_search_by_id(test_bill.getReq_id().toString());
		Test_base_info test_base_info=test_bill_Service.search_a_test_base_info_by_testid(test_id);
		String return_s="";
		
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");	
		
		String finish_d=sdf.format(test_bill.getTest_complete_date());
		String getCreate_time="";
		if(test_base_info!=null){
			getCreate_time=sdf.format(test_base_info.getCreate_time());
		}
		
		 return_s="["
				+ "{type: 'fieldset', label: '维护测试信息',  list:["
								+"{type:'block',list:["
									+"{type : 'input',name : 'req_bill_no',label : '需求编号',inputWidth:'150',labelWidth:'70',position:'label-left',value:'"+req_bill.getReq_bill_no()+"',disabled:'true'},"
									+"{type : 'newcolumn'},"
									+"{type : 'input',name : 'req_title',label : '测试项目',inputWidth:'300',position:'label-left',offsetLeft:'25',value:'"+req_bill.getReq_title()+"',disabled:'true'}"
								+"]},"
								+"{type:'block',list:["
									+"{type : 'input',name : 'req_bill_no',label : '测试技术负责人',inputWidth:'120',position:'label-left',value:'"+test_bill.getTest_technical_director()+"',disabled:'true'},"
									+"{type : 'newcolumn'},"
									+"{type : 'input',name : 'req_title',label : '自测试报告',labelWidth:'70',position:'label-left',offsetLeft:'25',value:'"+test_bill.getTest_report_status()+"',disabled:'true'},"
									+"{type : 'newcolumn'},"
									+"{type : 'calendar',name : 'create_date_start',label : '要求完成日期',position:'label-left',offsetLeft:'25',dateFormat:'%Y-%m-%d', value:'"+finish_d+"', required:'true',disabled:'true'}"									
								+"]},"
								+"{type:'block',list:["
									+"{type : 'input',name : 'test_receive_date',label : '测试接收时间',inputWidth:'120',labelWidth:'100',position:'label-left',value:'"+sdf.format(test_bill.getCreate_date())+"',disabled:'true'},"
									+"{type : 'newcolumn'},"
									+"{type : 'input',name : 'test_assign_date',label : '测试分配时间',inputWidth:'120',offsetLeft:'25',position:'label-left',value:'"+getCreate_time+"',disabled:'true'}"
								+"]}"
							+"]"
					+ "}"
				+"]";
	
	return return_s;	
		
	}
	@RequestMapping(value = "/test_list_mgnt_form_onload", method = { RequestMethod.GET })
	public String test_list_mgnt_form_onload(HttpServletRequest request) {			
		
			String return_s="";
			String start="";
			String end="";
			SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");	
			Date date = new java.sql.Date(new java.util.Date().getTime());
			end=sdf.format(date);
			SimpleDateFormat sdf2=new SimpleDateFormat("yyyy");	
			start=sdf2.format(date)+"-01-01";
			 return_s="["
					+ "{type: 'fieldset', label: '查询条件',  list:["
									+"{type:'block',list:["
										+"{type : 'input',name : 'req_title',label : '主题关键字',labelWidth:'70',position:'label-left'}"
									+"]},"
									
								 +"{type:'block',list:["
										+"{type : 'calendar',name : 'create_date_start',label : '送测日    开始',position:'label-left',dateFormat:'%Y-%m-%d', value:'"+start+"', required:'true'},"
										+"{type : 'newcolumn'},"
										+"{type : 'calendar',name : 'create_date_end',label : '结束',position:'label-left', dateFormat:'%Y-%m-%d',offsetLeft:'25',value:'"+end+"', required:'true'}"								
									+"]},"
								
								+"{type:'block',list:["
										+"{type : 'input',name : 'req_bill_no',label : '需求编号',inputWidth:'150',labelWidth:'70',position:'label-left'},"
										+"{type : 'newcolumn'},"
										+"{type : 'input',name : 'test_technical_director',label : '技术负责人',inputWidth:'150',position:'label-left', offsetLeft:'25'},"
										+"{type : 'newcolumn'},"
										+"{type : 'select',name : 'test_status',label : '测试状态',inputWidth:'150', offsetLeft:'25',options:["
											+"{text: '', value: ''},"
											+"{text: '已接收', value: '已接收'},"
											+"{text: '已退回', value: '已退回'},"		
											+"{text: '已完成', value: '已完成'},"		
											+"{text: '已分配',value: '已分配'}"
										+ "]}"
									+"]},"
									
									+"{type:'block',list:["
									+"{type : 'button',name : 'query_btn',value : '查询'}"																	
									+"]}"				
									
									//+"{type:'block',list:["
									//	+"{type : 'input',name : 'req_title',label : '需求主题',labelWidth:'70', inputWidth='700',position:'label-left', disabled:'true',value:'"+obj.getReq_title()+"'}"
									//+"]}"
								+"]"
						+ "}"
					+"]";
		
		return return_s;
				
	}


	
	@RequestMapping(value = "/test_search_for_test_modify", method = { RequestMethod.GET })
	public String test_search_for_test_modify(HttpServletRequest request) {

		// model.addAttribute("name", name);
		String params = request.getParameter("params");
		logger.info("test_assign_select_req_grid params " + params);
		String r_string = trans_2_json_req_search_for_test_modify(params);

		if (r_string != null) {
			// String
			// s_tmp="req_bill_no:"+r.get(0).getReq_bill_no()+";req_title:"+r.get(0).getReq_title()+";req_type:"+r.get(0).getReq_type()+";req_dept:"+r.get(0).getReq_offer_dept()+";req_complete_date:"+r.get(0).getRequired_completion_date();

			logger.info("test_assign_select_req_grid return :" + r_string);
			return r_string;
		} else {
			return null;
		}

	}

	@RequestMapping(value = "/test_search_for_test_modify_my", method = { RequestMethod.GET })
	public String test_search_for_test_modify_my(HttpServletRequest request,HttpSession httpSession) {
		String user_name=(String) httpSession.getAttribute("user"); 
		// model.addAttribute("name", name);
		String params = request.getParameter("params");
		logger.info("test_assign_select_req_grid params " + params);
		String r_string = trans_2_json_req_search_for_test_modify_my(params,user_name);

		if (r_string != null) {
			// String
			// s_tmp="req_bill_no:"+r.get(0).getReq_bill_no()+";req_title:"+r.get(0).getReq_title()+";req_type:"+r.get(0).getReq_type()+";req_dept:"+r.get(0).getReq_offer_dept()+";req_complete_date:"+r.get(0).getRequired_completion_date();

			logger.info("test_assign_select_req_grid return :" + r_string);
			return r_string;
		} else {
			return null;
		}

	}
	
	private String trans_2_json_req_search_for_test_modify_my(String params,String user_name) {
		String r_start = "{rows:[";
		String r_end = "]}";
		String r_content = "";
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");	
		List<Test_bill> obj=test_bill_Service.search_test_bill_list_my(params,user_name);
		for (int i = 0; i < obj.size(); i++) {
			Test_bill element = obj.get(i);
			Req_bill req_bill=req_bill_Service.req_bill_search_by_id(element.getReq_id().toString());
			
			String tmp_start = "{ id:" + (i + 1) + ",data:[";
			String tmp_end = "]}";
			if ((i + 1) < obj.size()) {
				tmp_end = tmp_end + ",";
			}
			java.util.Date d=element.getTest_complete_date();
			String d_str=sdf.format(d);
			String tmp_content = "'0',";
			//String tmp_content = "";
			tmp_content = tmp_content + "'" + element.getId() + "',";
			tmp_content = tmp_content + "'" + req_bill.getReq_bill_no() + "',";
			tmp_content = tmp_content + "'" + element.getTest_status() + "',";
			tmp_content = tmp_content + "'" + req_bill.getReq_title() + "',";
			tmp_content = tmp_content + "'" + element.getTest_technical_director() + "',";
			tmp_content = tmp_content + "'" + d_str + "'";
			//tmp_content = tmp_content + "'" + element.getReq_status() + "'";
			r_content = r_content + tmp_start + tmp_content + tmp_end;
		}
		String r_s = r_start + r_content + r_end;
		logger.info("trans_2_json :" + r_s);
		return r_s;
	}

	private String trans_2_json_req_search_for_test_modify(String params) {
		String r_start = "{rows:[";
		String r_end = "]}";
		String r_content = "";
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");	
		List<Test_bill> obj=test_bill_Service.search_test_bill_list(params);
		for (int i = 0; i < obj.size(); i++) {
			Test_bill element = obj.get(i);
			Req_bill req_bill=req_bill_Service.req_bill_search_by_id(element.getReq_id().toString());
			
			String tmp_start = "{ id:" + (i + 1) + ",data:[";
			String tmp_end = "]}";
			if ((i + 1) < obj.size()) {
				tmp_end = tmp_end + ",";
			}
			java.util.Date d=element.getTest_complete_date();
			String d_str=sdf.format(d);
			String tmp_content = "'0',";
			//String tmp_content = "";
			tmp_content = tmp_content + "'" + element.getId() + "',";
			tmp_content = tmp_content + "'" + req_bill.getReq_bill_no() + "',";
			tmp_content = tmp_content + "'" + element.getTest_status() + "',";
			tmp_content = tmp_content + "'" + req_bill.getReq_title() + "',";
			tmp_content = tmp_content + "'" + element.getTest_technical_director() + "',";
			tmp_content = tmp_content + "'" + d_str + "'";
			//tmp_content = tmp_content + "'" + element.getReq_status() + "'";
			r_content = r_content + tmp_start + tmp_content + tmp_end;
		}
		String r_s = r_start + r_content + r_end;
		logger.info("trans_2_json :" + r_s);
		return r_s;
	}
	
	
	@RequestMapping(value = "/test_modify_detail_testing_info_save")
	public boolean test_modify_detail_testing_info_save(HttpServletRequest request,Model model,Test_testing_info test_testing_info ) {

		logger.info("test_modify_detail_testing_info_save " );
		model.addAttribute("Test_testing_info", test_testing_info);
		boolean r = test_bill_Service.save_test_testing_info(test_testing_info);

		return r;
		

	}

	
	@RequestMapping(value = "/test_modify_detail_test_info_onload", method = { RequestMethod.GET })
	public String test_modify_detail_test_info_onload(HttpServletRequest request) {
		String test_id = request.getParameter("test_id");
		Test_bill test_bill=test_bill_Service.search_a_test_bill_by_id(test_id);
		Req_bill req_bill=req_bill_Service.req_bill_search_by_id(test_bill.getReq_id().toString());
		Test_base_info test_base_info=test_bill_Service.search_a_test_base_info_by_testid(test_id);
		Test_testing_info test_testing_info=test_bill_Service.search_a_test_testing_info_by_testid(test_id);
		String test_result="";		
		float test_workload=0;
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");	
		
		String test_start_date="";
		String test_end_date="";
		Integer deffect_critical_count=0;
		Integer deffect_ordinary_count=0;
		Integer deffect_other_count=0;
		String test_channel_is_Teller="";
		String test_channel_is_Core="";
		String test_channel_is_ATM="";
		String test_channel_is_self_service_terminals="";
		String test_channel_is_Tel_bank="";
		String test_channel_is_Net_bank="";
		String test_channel_is_Mobile_bank="";
		String test_channel_is_Fill_form_machine="";
		String test_channel_is_Other="";
		String test_channel_other_info="";
		String test_type_is_Query="";
		String test_type_is_Maintain="";
		String test_type_is_Finance="";
		String test_type_is_Other="";
		String test_type_Other_info="";
		String relation_funcation="";
		String test_cover_is_certificate="";
		String test_cover_is_certificate_Normal="";
		String test_cover_is_certificate_Exception="";
		String test_cover_is_account="";
		String test_cover_is_account_Normal="";
		String test_cover_is_account_Exception="";
		String test_cover_is_balance="";
		String test_cover_is_balance_Normal="";
		String test_cover_is_balance_Exception="";
		String test_cover_is_password="";
		String test_cover_is_password_Normal="";
		String test_cover_is_password_Exception="";
		String test_cover_is_accounting_entry="";
		String test_cover_is_limit_management="";
		String test_cover_is_business_process="";
		String test_cover_is_operate_ui="";
		String test_cover_is_batch_check="";
		String test_cover_is_MEMO_check="";
		String test_cover_is_Authorized_handle="";
		String test_cover_is_data_aync="";
		String test_cover_is_answer_info="";
		String test_cover_is_account_checking="";
		String test_cover_is_bill_print="";
		String test_cover_is_Electronic_receipt="";
		String test_cover_is_opposite_info="";
		String test_cover_is_summary_code="";
		String test_cover_is_report_form_info="";
		String test_cover_is_SMS="";
		String test_cover_is_hardware="";
		String test_cover_is_load_test="";
		String test_cover_is_timeout="";
		String test_cover_is_exception="";
		String test_cover_is_other="";
		String test_cover_other_info="";
		String other_remark="";
		String plan_online_date="";
		String plan_online_step="";
		String contingency_plan="";
		String contingency_plan_remark="";
		String online_trace_info="";
		String online_trace_start_date="";
		String online_trace_end_date="";
		String online_tracer="";
		String attention_is_inform_dept_offer="";
		String attention_is_business_check="";
		String attention_is_bank_head_check="";
		String attention_is_bank_head_check_yes="";
		String attention_is_bank_head_check_no="";
		String attention_is_other="";
		String attention_other_info="";
		
		if(test_testing_info!=null){
			test_result=test_testing_info.getTest_result();			
			test_workload=test_testing_info.getTest_workload();
			
			if(test_testing_info.getTest_start_date()!=null){				 
				 test_start_date=sdf.format(test_testing_info.getTest_start_date());
			}
			
			if(test_testing_info.getTest_end_date()!=null){	
				test_end_date=sdf.format(test_testing_info.getTest_end_date());
			}
			deffect_critical_count=test_testing_info.getDeffect_critical_count();
			deffect_ordinary_count=test_testing_info.getDeffect_ordinary_count();
			deffect_other_count=test_testing_info.getDeffect_other_count();
			test_channel_is_Teller=test_testing_info.getTest_channel_is_Teller();
			test_channel_is_Core=test_testing_info.getTest_channel_is_Core();
			test_channel_is_ATM=test_testing_info.getTest_channel_is_ATM();
			test_channel_is_self_service_terminals=test_testing_info.getTest_channel_is_self_service_terminals();
			test_channel_is_Tel_bank=test_testing_info.getTest_channel_is_Tel_bank();
			test_channel_is_Net_bank=test_testing_info.getTest_channel_is_Net_bank();
			test_channel_is_Mobile_bank=test_testing_info.getTest_channel_is_Mobile_bank();
			test_channel_is_Fill_form_machine=test_testing_info.getTest_channel_is_Fill_form_machine();
			test_channel_is_Other=test_testing_info.getTest_channel_is_Other();
			test_channel_other_info=test_testing_info.getTest_channel_other_info();
			test_type_is_Query=test_testing_info.getTest_type_is_Query();
			test_type_is_Maintain=test_testing_info.getTest_type_is_Maintain();
			test_type_is_Finance=test_testing_info.getTest_type_is_Finance();
			test_type_is_Other=test_testing_info.getTest_type_is_Other();
			test_type_Other_info=test_testing_info.getTest_type_Other_info();
			relation_funcation=test_testing_info.getRelation_funcation();
			test_cover_is_certificate=test_testing_info.getTest_cover_is_certificate();
			test_cover_is_certificate_Normal=test_testing_info.getTest_cover_is_certificate_Normal();
			test_cover_is_certificate_Exception=test_testing_info.getTest_cover_is_certificate_Exception();
			test_cover_is_account=test_testing_info.getTest_cover_is_account();
			test_cover_is_account_Normal=test_testing_info.getTest_cover_is_account_Normal();
			test_cover_is_account_Exception=test_testing_info.getTest_cover_is_account_Exception();
			test_cover_is_balance=test_testing_info.getTest_cover_is_balance_Normal();
			test_cover_is_balance_Normal=test_testing_info.getTest_cover_is_balance_Normal();
			test_cover_is_balance_Exception=test_testing_info.getTest_cover_is_balance_Exception();
			test_cover_is_password=test_testing_info.getTest_cover_is_password();
			test_cover_is_password_Normal=test_testing_info.getTest_cover_is_password_Normal();
			test_cover_is_password_Exception=test_testing_info.getTest_cover_is_password_Exception();
			test_cover_is_accounting_entry=test_testing_info.getTest_cover_is_accounting_entry();
			test_cover_is_limit_management=test_testing_info.getTest_cover_is_limit_management();
			test_cover_is_business_process=test_testing_info.getTest_cover_is_business_process();
			test_cover_is_operate_ui=test_testing_info.getTest_cover_is_operate_ui();
			test_cover_is_batch_check=test_testing_info.getTest_cover_is_batch_check();
			test_cover_is_MEMO_check=test_testing_info.getTest_cover_is_MEMO_check();
			test_cover_is_Authorized_handle=test_testing_info.getTest_cover_is_Authorized_handle();
			test_cover_is_data_aync=test_testing_info.getTest_cover_is_data_aync();
			test_cover_is_answer_info=test_testing_info.getTest_cover_is_answer_info();
			test_cover_is_account_checking=test_testing_info.getTest_cover_is_account_checking();
			test_cover_is_bill_print=test_testing_info.getTest_cover_is_bill_print();
			test_cover_is_Electronic_receipt=test_testing_info.getTest_cover_is_Electronic_receipt();
			test_cover_is_opposite_info=test_testing_info.getTest_cover_is_opposite_info();
			test_cover_is_summary_code=test_testing_info.getTest_cover_is_summary_code();
			test_cover_is_report_form_info=test_testing_info.getTest_cover_is_report_form_info();
			test_cover_is_SMS=test_testing_info.getTest_cover_is_SMS();
			test_cover_is_hardware=test_testing_info.getTest_cover_is_hardware();
			test_cover_is_load_test=test_testing_info.getTest_cover_is_load_test();
			test_cover_is_timeout=test_testing_info.getTest_cover_is_timeout();
			test_cover_is_exception=test_testing_info.getTest_cover_is_exception();
			test_cover_is_other=test_testing_info.getTest_cover_is_other();
			test_cover_other_info=test_testing_info.getTest_cover_other_info();
			other_remark=test_testing_info.getOther_remark();
			
			if(test_testing_info.getPlan_online_date()!=null){	
				plan_online_date=sdf.format(test_testing_info.getPlan_online_date());
			}
			
			
			plan_online_step=test_testing_info.getPlan_online_step();
			contingency_plan=test_testing_info.getContingency_plan();
			contingency_plan_remark=test_testing_info.getContingency_plan_remark();
			online_trace_info=test_testing_info.getOnline_trace_info();
			
			if(test_testing_info.getOnline_trace_start_date()!=null){	
				online_trace_start_date=sdf.format(test_testing_info.getOnline_trace_start_date());
			}
			

			if(test_testing_info.getOnline_trace_end_date()!=null){	
				online_trace_end_date=sdf.format(test_testing_info.getOnline_trace_end_date());
			}
			
			online_tracer=test_testing_info.getOnline_tracer();
			attention_is_inform_dept_offer=test_testing_info.getAttention_is_inform_dept_offer();
			attention_is_business_check=test_testing_info.getAttention_is_business_check();
			attention_is_bank_head_check=test_testing_info.getAttention_is_bank_head_check();
			attention_is_bank_head_check_yes=test_testing_info.getAttention_is_bank_head_check_yes();
			attention_is_bank_head_check_no=test_testing_info.getAttention_is_bank_head_check_no();
			attention_is_other=test_testing_info.getAttention_is_other();
			attention_other_info=test_testing_info.getAttention_other_info();
		}
		
	
		
		
		
		String json_online_tracer="";
		List<User> list_u=userService.getAllUserList();
		String json_all_user=trans_all_user_2_json(list_u);		
		json_online_tracer="{text: '', value: ''},"+json_all_user;
		//String online_tracer=test_testing_info.getOnline_tracer();
		
		String return_s="";
		String  display_export_btn="";
		if(test_result!=null){
			if(test_result.length()>1){
				display_export_btn="{type : 'button',name : 'export_btn',value : '导出上线申请表（excel）'}";
			}
		}
		
		return_s="["
				+ "{type: 'block', label: '分配需求',  list:["
								+"{type:'block',list:["						
									+"{type : 'hidden',name : 'test_id',label : 'test ID',labelWidth:'70',position:'label-left', value:'"+test_id+"'}"
								+"]},"								
								+"{type:'block',list:["
										+"{type : 'select',name : 'test_result',label : '测试结论',labelWidth:'100',inputWidth:'150', required:'true',value:'"+test_result+"', options:["
												+"{text: '', value: ''},"												
												+"{text: '通过', value: '通过'},"
												+"{text: '不通过', value: '不通过'}"
										+ "]},"										
										+"{type : 'newcolumn'},"
										+"{type : 'input',name : 'test_workload',label : '测试时长',labelWidth:'100',inputWidth:'150',position:'label-left', required:'true',validate:'check_workload',value:'"+test_workload+"',offsetLeft:'25'},"
										+"{type : 'newcolumn'},"
										+"{type : 'input',name : 'test_workload_label',label : '个工作日',inputWidth:'0',position:'label-left', offsetLeft:'5'}"
								+"]},"											
								+"{type:'block',list:["
										+"{type : 'calendar',name : 'test_start_date',label : '测试开始时间',labelWidth:'100',position:'label-left', inputWidth:'150', value:'"+test_start_date+"', required:'true'},"
										+"{type : 'newcolumn'},"
										+"{type : 'calendar',name : 'test_end_date',label : '结束时间',labelWidth:'100',position:'label-left', inputWidth:'150', value:'"+test_end_date+"', required:'true',offsetLeft:'25'}"										
									+"]},"
								+"{type:'fieldset',label: '发现缺陷数',list:["
										+"{type : 'input',name : 'deffect_critical_count',label : '严重及以上',labelWidth:'100',inputWidth:'150',position:'label-left', required:'true',value:'"+deffect_critical_count+"'},"
										+"{type : 'newcolumn'},"
										+"{type : 'input',name : 'deffect_ordinary_count',label : '一般级别',labelWidth:'100',inputWidth:'150',position:'label-left', required:'true',offsetLeft:'25',value:'"+deffect_ordinary_count+"'},"
										+"{type : 'newcolumn'},"
										+"{type : 'input',name : 'deffect_other_count',label : '其它级别',labelWidth:'100',inputWidth:'150',position:'label-left', required:'true',value:'"+deffect_other_count+"'}"									
								+"]},"		
								+"{type:'fieldset',label: '测试渠道',list:["
										+"{type:'block',list:["
													+"{type : 'checkbox',name : 'test_channel_is_Teller',label : 'TELLER',labelWidth:'100',inputWidth:'150',position:'label-right',checked:'"+test_channel_is_Teller+"'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_channel_is_Core',label : '核心',labelWidth:'100',inputWidth:'150',checked:'"+test_channel_is_Core+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_channel_is_ATM',label : 'ATM',labelWidth:'100',inputWidth:'150',checked:'"+test_channel_is_ATM+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_channel_is_self_service_terminals',label : '自助终端',labelWidth:'100',inputWidth:'150',checked:'"+test_channel_is_self_service_terminals+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_channel_is_Tel_bank',label : '电话银行',labelWidth:'100',inputWidth:'150',checked:'"+test_channel_is_Tel_bank+"',position:'label-right'},"
										+"]},"
										+"{type:'block',list:["
													+"{type : 'checkbox',name : 'test_channel_is_Net_bank',label : '网银',labelWidth:'100',inputWidth:'150',checked:'"+test_channel_is_Net_bank+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_channel_is_Mobile_bank',label : '手机银行',labelWidth:'100',inputWidth:'150',checked:'"+test_channel_is_Mobile_bank+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_channel_is_Fill_form_machine',label : '填单机',labelWidth:'100',inputWidth:'150',checked:'"+test_channel_is_Fill_form_machine+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_channel_is_Other',label : '其他客户端',labelWidth:'100',inputWidth:'150',checked:'"+test_channel_is_Other+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'input',name : 'test_channel_other_info',label : '',labelWidth:'100',inputWidth:'150',position:'label-left', value:'"+test_channel_other_info+"'}"
										+"]},"																			
								+"]},"
								+"{type:'fieldset',label: '测试类型',list:["
										+"{type:'block',list:["
													+"{type : 'checkbox',name : 'test_type_is_Query',label : '查询交易',labelWidth:'100',inputWidth:'150',checked:'"+test_type_is_Query+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_type_is_Maintain',label : '维护交易',labelWidth:'100',inputWidth:'150',checked:'"+test_type_is_Maintain+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_type_is_Finance',label : '财务交易',labelWidth:'100',inputWidth:'150',checked:'"+test_type_is_Finance+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'test_type_is_Other',label : '其他类型',labelWidth:'100',inputWidth:'150',checked:'"+test_type_is_Other+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'input',name : 'test_type_Other_info',label : '',labelWidth:'100',inputWidth:'150',position:'label-left', value:'"+test_type_Other_info+"'}"
										+"]},"	
								+"]},"
								+"{type:'block',list:["
									+"{type : 'editor',name : 'relation_funcation',label : '关联功能',position:'label-top', required:'true',inputWidth:'800', inputHeight:'200',value:''}"																
								+"]},"
								+"{type:'fieldset',label: '案例覆盖',list:["
										+"{type:'block',list:["
												+"{type : 'checkbox',name : 'test_cover_is_certificate',label : '凭证状态(', checked:'"+test_cover_is_certificate+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_certificate_Normal',label : '正常', checked:'"+test_cover_is_certificate_Normal+"',offsetLeft:'10',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_certificate_Exception',label : '异常 )',checked:'"+test_cover_is_certificate_Exception+"',offsetLeft:'10',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_account',offsetLeft:'25',label : '账户状态(', checked:'"+test_cover_is_account+"',offsetLeft:'50',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_account_Normal',label : '正常',offsetLeft:'10',checked:'"+test_cover_is_account_Normal+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_account_Exception',label : '异常 )',offsetLeft:'10',checked:'"+test_cover_is_account_Exception+"',position:'label-right'}"
										+"]},"
										+"{type:'block',list:["
												+"{type : 'checkbox',name : 'test_cover_is_balance',label : '余额校验(',checked:'"+test_cover_is_balance+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_balance_Normal',label : '  足',offsetLeft:'10',checked:'"+test_cover_is_balance_Normal+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_balance_Exception',label : '不足 )',offsetLeft:'25',checked:'"+test_cover_is_balance_Exception+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_password',offsetLeft:'25',label : '密码校验(', offsetLeft:'50',checked:'"+test_cover_is_password+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_password_Normal',label : '正确',offsetLeft:'10',checked:'"+test_cover_is_password_Normal+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_password_Exception',label : '错误 )',offsetLeft:'10',checked:'"+test_cover_is_password_Exception+"',position:'label-right'}"
										+"]},"
										+"{type:'block',list:["
												+"{type : 'checkbox',name : 'test_cover_is_accounting_entry',label : '会计分录',labelWidth:'120',checked:'"+test_cover_is_accounting_entry+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_limit_management',label : '限额管理',labelWidth:'100',checked:'"+test_cover_is_limit_management+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_business_process',label : '业务流程',labelWidth:'120',checked:'"+test_cover_is_business_process+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_operate_ui',label : '操作界面',labelWidth:'120',checked:'"+test_cover_is_operate_ui+"',position:'label-right'}"																							
										+"]},"
										+"{type:'block',list:["
												+"{type : 'checkbox',name : 'test_cover_is_batch_check',label : '批处理验证',labelWidth:'120',checked:'"+test_cover_is_batch_check+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_MEMO_check',label : 'MEMO验证',labelWidth:'100',checked:'"+test_cover_is_MEMO_check+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_Authorized_handle',label : '授权操作',labelWidth:'120',checked:'"+test_cover_is_Authorized_handle+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_data_aync',label : '数据同步',labelWidth:'120',checked:'"+test_cover_is_data_aync+"',position:'label-right'}"																							
										+"]},"												
										+"{type:'block',list:["
												+"{type : 'checkbox',name : 'test_cover_is_answer_info',label : '应答信息',labelWidth:'120',checked:'"+test_cover_is_answer_info+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_account_checking',label : '对账差错',labelWidth:'100',checked:'"+test_cover_is_account_checking+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_bill_print',label : '清单打印 ',labelWidth:'120',checked:'"+test_cover_is_bill_print+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_Electronic_receipt',label : '电子回单',labelWidth:'120',checked:'"+test_cover_is_Electronic_receipt+"',position:'label-right'}"																							
										+"]},"												
										+"{type:'block',list:["
												+"{type : 'checkbox',name : 'test_cover_is_opposite_info',label : '对手信息',labelWidth:'120',checked:'"+test_cover_is_opposite_info+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_summary_code',label : '摘要代码',labelWidth:'100',checked:'"+test_cover_is_summary_code+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_report_form_info',label : '报表信息',labelWidth:'120',checked:'"+test_cover_is_report_form_info+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_SMS',label : '短信相关',labelWidth:'120',checked:'"+test_cover_is_SMS+"',position:'label-right'}"																							
										+"]},"												
										+"{type:'block',list:["
												+"{type : 'checkbox',name : 'test_cover_is_hardware',label : '硬件设备',labelWidth:'120',checked:'"+test_cover_is_hardware+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_load_test',label : '压力测试',labelWidth:'100',checked:'"+test_cover_is_load_test+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_timeout',label : '超时处理',labelWidth:'120',checked:'"+test_cover_is_timeout+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'checkbox',name : 'test_cover_is_exception',label : '异常处理',labelWidth:'120',checked:'"+test_cover_is_exception+"',position:'label-right'}"																							
										+"]},"												
										+"{type:'block',list:["
												+"{type : 'checkbox',name : 'test_cover_is_other',label : '特殊/其他',labelWidth:'100',inputWidth:'150',checked:'"+test_cover_is_other+"',position:'label-right'},"
												+"{type : 'newcolumn'},"
												+"{type : 'input',name : 'test_cover_other_info',label : '',labelWidth:'100',inputWidth:'150',position:'label-left', value:'"+test_cover_other_info+"'}"																			
										+"]},"												
										
								+"]},"
								+"{type:'block',list:["
										+"{type : 'editor',name : 'other_remark',label : '其他说明',position:'label-top', inputWidth:'800', inputHeight:'200',value:''}"																
								+"]},"		
								+"{type:'block',list:["
										+"{type : 'calendar',name : 'plan_online_date',label : '计划投产日',labelWidth:'100',position:'label-left', inputWidth:'150', value:'"+plan_online_date+"', required:'true'},"
										+"{type : 'newcolumn'},"
										+"{type : 'select',name : 'plan_online_step',label : '投产步骤',labelWidth:'100',inputWidth:'200', required:'true',offsetLeft:'25',value:'"+plan_online_step+"', options:["
												+"{text: '', value: ''},"												
												+"{text: '直接部署应用', value: '直接部署应用'},"
												+"{text: '同步部署参数应用', value: '同步部署参数应用'},"
												+"{text: '先部署参数，再部署应用', value: '先部署参数，再部署应用'},"
												+"{text: '先部署应用，再部署参数', value: '先部署应用，再部署参数'},"
												+"{text: '步骤见附件', value: '步骤见附件'},"
												+"{text: '其他', value: '其他'}"
										+ "]}"																	
								+"]},"
								+"{type:'block',list:["
										+"{type : 'select',name : 'contingency_plan',label : '应急预案',labelWidth:'100',inputWidth:'400', required:'true',value:'"+contingency_plan+"', options:["
												+"{text: '无', value: '无'},"												
												+"{text: '回退版本或热部署新版本', value: '回退版本或热部署新版本'},"
												+"{text: '影响小，可暂停（非重点业务、无客户或少量客户使用）', value: '影响小，可暂停（非重点业务、无客户或少量客户使用）'},"
												+"{text: '有替代交易功能或渠道', value: '有替代交易功能或渠道'},"
												+"{text: '其他，预案见附件', value: '其他，预案见附件'}"
										+ "]},"			
										+"{type : 'newcolumn'},"
										+"{type : 'input',name : 'contingency_plan_remark',label : '原因',labelWidth:'80',inputWidth:'150',position:'label-left', required:'true',value:'"+contingency_plan_remark+"',offsetLeft:'25'}"															
								+"]},"
								+"{type:'block',list:["
										+"{type : 'input',name : 'online_trace_info',label : '跟踪事项',labelWidth:'100',inputWidth:'400',position:'label-left', required:'true',value:'"+online_trace_info+"'}"															
								+"]},"
								+"{type:'block',list:["
										+"{type : 'calendar',name : 'online_trace_start_date',label : '跟踪开始时间',labelWidth:'100',position:'label-left', inputWidth:'150', value:'"+online_trace_start_date+"', required:'true'},"
										+"{type : 'newcolumn'},"
										+"{type : 'calendar',name : 'online_trace_end_date',label : '跟踪结束时间',labelWidth:'100',position:'label-left', inputWidth:'150', value:'"+online_trace_end_date+"', required:'true',offsetLeft:'25'},"
										+"{type : 'newcolumn'},"
										+"{type: 'select', label: '跟踪人', name: 'online_tracer', inputWidth:'150',required:'true',value:'"+online_tracer+"',options:["
										+json_online_tracer
		 								+"]"
 								+ "},"
								+"]},"
								+"{type:'fieldset',label: '注意事项',list:["
										+"{type:'block',list:["
													+"{type : 'checkbox',name : 'attention_is_inform_dept_offer',label : '通知需求提出部门、提出人',checked:'"+attention_is_inform_dept_offer+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'attention_is_business_check',label : '相关业务开展审批已完成',checked:'"+attention_is_business_check+"',position:'label-right'}"													
										+"]},"
										+"{type:'block',list:["													
													+"{type : 'checkbox',name : 'attention_is_bank_head_check',label : '是否需要行领导审批',checked:'"+attention_is_bank_head_check+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'attention_is_bank_head_check_yes',label : '需要',position:'label-right',checked:'"+attention_is_bank_head_check_yes+"',offsetLeft:'50'},"
													+"{type : 'newcolumn'},"
													+"{type : 'checkbox',name : 'attention_is_bank_head_check_no',label : '不需要',position:'label-right',checked:'"+attention_is_bank_head_check_no+"',offsetLeft:'25'}"
										+"]},"
										+"{type:'block',list:["
													+"{type : 'checkbox',name : 'attention_is_other',label : '其他',labelWidth:'100',inputWidth:'150',checked:'"+attention_is_other+"',position:'label-right'},"
													+"{type : 'newcolumn'},"
													+"{type : 'input',name : 'attention_other_info',label : '',labelWidth:'100',inputWidth:'300',position:'label-left', checked:'"+attention_other_info+"',value:'"+attention_other_info+"'}"
										+"]}"
								+"]},"										
								+"{type:'block',list:["
									+"{type : 'button',name : 'testing_info_save_btn',value : '保存信息'},"
									+"{type : 'newcolumn'},"
									+display_export_btn
									//+"{type : 'button',name : 'export_btn',value : '导出上线申请表（excel）'}"										
								+"]}"											
								//+"{type:'block',list:["
								//	+"{type : 'input',name : 'req_title',label : '需求主题',labelWidth:'70', inputWidth='700',position:'label-left', disabled:'true',value:'"+obj.getReq_title()+"'}"
								//+"]}"
							+"]"
					+ "}"
				+"]";
		
		logger.info("retrun info :" + return_s);
		return return_s;
		
	}
	
	private String trans_all_user_2_json(List<User> list_u) {
		String json_s="";
		for (int i = 0; i < list_u.size(); i++) {
			User u = list_u.get(i);
			String tmp=u.getName();
			if(i==list_u.size()){
				json_s=json_s+"{value : '"+tmp+"',text:'"+tmp+"'}";
			}else{
				json_s=json_s+"{value : '"+tmp+"',text:'"+tmp+"'},";
			}
		}		
		
		return json_s;
	}
	
}
